package com.dk.util.config;

import com.dk.util.file.ConfigLoadTool;

import java.util.Properties;

/**
 * 配置读取类
 */
public class ReadConfig {
    //okhttp请求超时时间
    public static String CONNECTTIMEOUT = "";
    //okhttp写入超时时间
    public static String WRITETIMEOUT = "";
    //okhttp读取超时时间
    public static String READTIMEOUT = "";
    //请求头:connection
    public static String CONNECTION = "";
    //请求头:contentType
    public static String CONTENTTYPE = "";
    //JDBC驱动
    public static String JDBC_DRIVER = "";
    //JDBC配置文件路径
    public static String JDBC_CONFIGPATH = "";
    //数据文件路径
    public static String DATA_PATH = "";
    //接口数据sheet名称
    public static String DATA_SHEET_API = "";
    //用例数据sheet名称
    public static String DATA_SHEET_CASE = "";
    //动作数据sheet名称
    public static String DATA_SHEET_ACTION = "";
    //用例数据sheet名称
    public static String DATA_SHEET_VAR = "";
    //环境地址
    public static String HOST = "";

    static{
        //src\main\resources\config.properties测试
        Properties properties = ConfigLoadTool.configLoad("..//src//main//resources//config.properties");
        CONNECTTIMEOUT = properties.getProperty("okhttp.connecttimeout");
        WRITETIMEOUT = properties.getProperty("okhttp.writetimeout");
        READTIMEOUT = properties.getProperty("okhttp.readtimeout");
        CONNECTION = properties.getProperty("header.connection");
        CONTENTTYPE = properties.getProperty("header.contenttype");
        JDBC_DRIVER = properties.getProperty("jdbc.driverClassName");
        DATA_PATH = properties.getProperty("data.path");
        DATA_SHEET_API = properties.getProperty("data.sheet.api");
        DATA_SHEET_CASE = properties.getProperty("data.sheet.case");
        DATA_SHEET_ACTION = properties.getProperty("data.sheet.action");
        DATA_SHEET_VAR = properties.getProperty("data.sheet.var");
        JDBC_CONFIGPATH = properties.getProperty("jdbc.configpath");
        HOST = properties.getProperty("okhttp.host");
    }

}
